package sms.messaging;


import android.app.Activity;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class SmsActivity extends Activity 
{
    Button btnStart;
    Button btnStop;
    Button btnPauseContinue;
    EditText txtStatus;
    EditText txtFileName;
    EditText txtMessage;
 
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);        
 
        btnStart = (Button) findViewById(R.id.btnStart);
        btnStop = (Button) findViewById(R.id.btnStop);
        btnPauseContinue = (Button) findViewById(R.id.btnPauseContinue);
        txtStatus = (EditText) findViewById(R.id.txtStatus);
        txtFileName = (EditText) findViewById(R.id.txtFileName);
        txtMessage = (EditText) findViewById(R.id.txtMessage);
 
        btnStart.setOnClickListener(new View.OnClickListener() 
        {
            public void onClick(View v) 
            {           
            	startSmsService( v );
//                String phoneNo = txtPhoneNo.getText().toString();
//                String message = txtMessage.getText().toString();                 
//                if (phoneNo.length()>0 && message.length()>0)                
//                    sendSMS(phoneNo, message);                
//                else
//                    Toast.makeText(getBaseContext(), 
//                        "Please enter both phone number and message.", 
//                        Toast.LENGTH_SHORT).show();
            }
        });        
    }    
    
    private void startSmsService( View v )
    {
    	
    }
 
    //---sends an SMS message to another device---
    private void sendSMS(String phoneNumber, String message)
    {        
        PendingIntent pi = PendingIntent.getActivity( this, 0, new Intent(this, SmsActivity.class ), 0 );                
        SmsUtil.sendSms(phoneNumber, message, pi );        
    }   
    
    
    
}